#ifndef CPU_SCHEDULER_H
#define CPU_SCHEDULER_H

#include <QObject>
#include <QString>

// 添加SchedulerConfig结构体定义
struct SchedulerConfig {
    int checkInterval;
    int highFreqThreshold;
    int lowFreqThreshold;
    int highTempThreshold;
    int lowTempThreshold;
    int sustainedPeriod;
    int freqReduction;
    int freqIncrease;
    int minFreqLimit;
    bool enableTempControl;
    bool enableFreqControl;
    QString logFile;
    QString configFile;
};

class CpuScheduler : public QObject
{
    Q_OBJECT

public:
    explicit CpuScheduler(QObject *parent = nullptr);
    ~CpuScheduler();

    bool createService();
    bool createConfigFile();
    bool createServiceFile();
    bool isServiceActive();
    bool startService();
    bool stopService();
    bool resetCpuFrequency();
    
    void setConfig(const SchedulerConfig &config);
    SchedulerConfig getConfig() const;

private:
    SchedulerConfig m_config;
};

#endif // CPU_SCHEDULER_H